public class leetcode {
    public static int[] twoSum(int[] nums, int target) {
        int mb;
        for (int i = 0; i < nums.length - 1; i++) {
            for (int j = i + 1; j < nums.length; j++) {
                mb = nums[i] + nums[j];
                if (mb == target) {
                    return new int[]{i, j};
                }
            }
        }
        return null;
    }

    public static void main(String[] args) {
        int[] nums = {2, 7, 11, 15};
        int arget = 9;
        int[] arr = twoSum(nums, arget);
        System.out.print("[");
        System.out.print(arr[0]);
        System.out.print(",");
        System.out.print(arr[1]);
        System.out.print("]");
    }
}
